import request from './request.js';

// 登录
export function loginFun(params) {
  return request.post('/login/mnpLogin', params);
}

// 获取微信小程序配置信息
export function config() {
  return request.get('/index/config');
}
// 获取用户信息
export function userInfoFun() {
  return request.get('/user/info');
}
// 获取支付信息
export function payFun(params) {
  return request.post('/pay/prepay', params);
}

// 获取酒店房间列表
export function roomListFun(params) {
  return request.get('/hotel/room_list', params);
}

// 获取酒店详情
export function hotelDetailFun(params) {
  return request.get('/hotel/detail', params);
}

// 获取房间详情
export function roomDetailFun(params) {
  return request.get('/hotel/room_detail', params);
}

// 订单创建
export function orderCreateFun(params) {
  return request.post('/order/create', params);
}

// 订单详情
export function orderDetailFun(params) {
  return request.get('/order/detail', params);
}

// 订单列表
export function orderListFun(params) {
  return request.get('/order/list', params);
}

// 订单取消
export function orderCancelFun(params) {
  return request.post('/order/cancel', params);
}
// 订单退款
export function orderRefundFun(params) {
  return request.post('/pay/refund', params);
}



// 商品
export function goodsListFun(params) {
  return request.get('/goods/lists', params);
}

// 商品详情
export function goodsDetailFun(params) {
  return request.get('/goods/detail', params);
}

// 商品分类
export function goodsCateFun(params) {
  return request.get('/goods/cate', params);
}


// 购物车列表
export function cartListFun(params) {
  return request.get('/cart/lists', params);
}

// 购物车添加
export function cartAddFun(params) {
  return request.post('/cart/add', params);
}

// 购物车删除
export function cartDeleteFun(params) {
  return request.post('/cart/delete', params);
}

// 购物车更新
export function cartEditFun(params) {
  return request.post('/cart/edit', params);
}

// 购物车清空
export function cartClearFun(params) {
  return request.post('/cart/clear', params);
}

// 商城订单
// 创建商城订单
export function orderGoodsCreateFun(params) {
  return request.post('/goods_order/create', params);
}

// 商城订单列表
export function orderGoodsListFun(params) {
  return request.get('/goods_order/list', params);
}

// 商城订单详情
export function orderGoodsDetailFun(params) {
  return request.get('/goods_order/detail', params);
}

// 商城订单取消
export function orderGoodsCancelFun(params) {
  return request.post('/goods_order/cancel', params);
}





// 发布列表
export function postListFun(params) {
  return request.get('/post/lists', params);
}

// 发布详情
export function postDetailFun(params) {
  return request.get('/post/detail', params);
}

// 发布添加
export function postAddFun(params) {
  return request.post('/post/add', params);
}

// 发布删除
export function postDeleteFun(params) {
  return request.post('/post/delete', params);
}

// 发布更新
export function postEditFun(params) {
  return request.post('/post/edit', params);
}

// 发布评论
export function postCommentAddFun(params) {
  return request.post('/post/comment_add', params);
}

// 发布评论列表
export function postCommentListFun(params) {
  return request.get('/post/comment_list', params);
}

// 发布评论点赞
export function postCommentAgreeFun(params) {
  return request.post('/api/post/agree', params);
}

// 上传图片
export function uploadImageFun(params) {
  return request.post('/upload/image', params);
}

// 上传视频
export function uploadVideoFun(params) {
  return request.post('/upload/video', params);
}


// 发布评论回复
export function postCommentReplyAddFun(params) {
  return request.post('/post/reply_add', params);
}

// 用户信息设置
export function userSetInfoFun(params) {
  return request.post('/user/setInfo', params);
}

// 用户积分
export function userPointFun(params) {
  return request.get('/user/point', params);
}
